home *** CD-ROM | disk | FTP | other *** search
/ Hacker's Arsenal - The Cutting Edge of Hacking / Hacker's Arsenal - The Cutting Edge of Hacking.iso / texts / unixcheck.txt < prev    next >
PGP Signed Message  |  2001-07-11  |  87KB  |  1,821 lines

  1. -----BEGIN PGP SIGNED MESSAGE-----
  2.  
  3. ==============================================================================
  4. UNIX Computer Security Checklist (Version 1.1)       Last Update   19-Dec-1995
  5. ==============================================================================
  6. The Australian Computer Emergency Response Team has developed a checklist which
  7. assists in removing common and known security vulnerabilities under the UNIX
  8. Operating System.  It is based around recently discovered security
  9. vulnerabilities and other checklists which are readily available (see 
  10. references in Appendix C). 
  11.  
  12. This document can be retrieved via anonymous ftp from:
  13.    ftp://ftp.auscert.org.au/pub/auscert/papers/unix_security_checklist
  14.  
  15. For information about detecting or recovering from an intrusion, see the
  16. CERT security information document which can be retrieved via anonymous ftp
  17. from:
  18.    ftp://ftp.auscert.org.au/pub/cert/tech_tips/security_info
  19.  
  20. It is AUSCERT's intention to continue to update this checklist.  Any
  21. comments should be directed via email to auscert@auscert.org.au.  Before
  22. using this document, ensure you have the latest version.  New versions of this
  23. checklist will be placed in the same area on the ftp server and should be 
  24. checked for periodically. 
  25.  
  26. In order to make effective use of this checklist, readers will need to have 
  27. a good grasp of basic UNIX system administration concepts.  Refer to C.9 and 
  28. C.10 for books on UNIX system administration.
  29.  
  30. If possible, apply this checklist to a system before attaching it to a network.
  31.  
  32. In addition, we recommend that you use the checklist on a regular basis as well
  33. as after you install any patches or new versions of the operating system, with
  34. consideration given to the appropriateness of each action to your particular
  35. situation. 
  36.  
  37. Command examples have been supplied for BSD-like and SVR4-like systems (see
  38. Appendix F for operating system details and Appendix G for command details). 
  39. Full directory paths and program options may vary for different flavours of
  40. UNIX. If in doubt, consult your vendor documentation. 
  41.  
  42. For ease of use, the checklist has been organised into separate, logically
  43. cohesive sections.  All sections are important.  An abbreviated version of
  44. this checklist can be found in Appendix D. 
  45.  
  46. CHECKLIST INDEX:        1.0  Patches
  47.                         2.0  Network security
  48.                         3.0  ftpd and anonymous ftp
  49.                         4.0  Password and account security
  50.                         5.0  File system security
  51.                         6.0  Vendor operating system specific security
  52.                         7.0  Security and the X Window System
  53.     
  54. APPENDICES:      Appendix A  Other AUSCERT information sources
  55.                  Appendix B  Useful security tools
  56.                  Appendix C  References
  57.                  Appendix D  Abbreviated Checklist
  58.                  Appendix E  Shell Scripts
  59.                  Appendix F  Table of operating systems by flavour
  60.                  Appendix G  List of commands by flavour
  61.  
  62. Any trademarks which appear in this document are registered to their
  63. respective owners.
  64.  
  65. ==============================================================================
  66. 1.0  Patches 
  67. ==============================================================================
  68.    *    Retrieve the latest patch list from your vendor and install any 
  69.         patches not yet installed that are recommended for your system.
  70.             Some patches may re-enable default configurations.  For this 
  71.             reason, it is important to go through this checklist AFTER
  72.             installing ANY new patches or packages.
  73.    *    Details on obtaining patches may be found in Section 6.
  74.    *    Verify the digital signature of any signed files.  Tools like PGP may 
  75.         be used to sign files and to verify those signatures.
  76.         (Refer to B.15 for PGP access information).
  77.    *    If no digital signature is supplied but an md5(1) checksum is supplied,
  78.         then verify the checksum information to confirm that you have retrieved 
  79.         a valid copy.
  80.         (Refer to B.10 for MD5 access information).
  81.    *    If only a generic sum(1) checksum is provided, then check that.  Be
  82.         aware that the sum(1) checksum should not be considered secure.
  83.  
  84. ==============================================================================
  85. 2.0  Network security
  86. ==============================================================================
  87.         The following is a list of features that can be used to help
  88.         prevent attacks from external sources.
  89.  
  90.  2.1  Filtering
  91.    *    ENSURE that ONLY those services which are required from outside your 
  92.         domain are allowed through your router filters.
  93.             In particular, if the following are not required outside your
  94.             domain, then filter them out at the router.
  95.  
  96.              NAME     PORT  PROTOCOL            NAME    PORT  PROTOCOL
  97.  
  98.              echo     7     TCP/UDP             login   513   TCP
  99.              systat   11    TCP                 shell   514   TCP
  100.              netstat  15    TCP                 printer 515   TCP
  101.              bootp    67    UDP                 biff    512   UDP
  102.              tftp     69    UDP                 who     513   UDP
  103.              link     87    TCP                 syslog  514   UDP
  104.              supdup   95    TCP                 uucp    540   TCP
  105.              sunrpc   111   TCP/UDP             route   520   UDP
  106.              NeWS     144   TCP                 openwin 2000  TCP
  107.              snmp     161   UDP                 NFS     2049  UDP/TCP
  108.              xdmcp    177   UDP                 X11     6000 to 6000+n TCP
  109.              exec     512   TCP                 (where n is the maximum number
  110.                                                  of X servers you will have)
  111.  
  112.         Note: Any UDP service that replies to an incoming packet may be 
  113.               subject to a denial of service attack.
  114.  
  115.         See CERT advisory CA-95.01 (C.8) for more details.
  116.  
  117.         Filtering is difficult to implement correctly.  For information on
  118.         packet filtering, please see Firewalls and Internet Security (C.6)
  119.         and Building Internet Firewalls (C.7).
  120.  
  121.  2.2  "r" commands
  122.  
  123.   2.2.1 If you don't NEED to use the "r" commands...
  124.    *    DO disable all "r" commands (rlogin, rsh etc.) unless specifically 
  125.         required.
  126.             This may increase your risk of password exposure in network
  127.             sniffer attacks, but "r" commands have been a regular source of 
  128.             insecurities and attacks.  Disabling them is by far the lesser of 
  129.             the two evils (see 2.9.1).
  130.  
  131.   2.2.2 If you must run the "r" commands...
  132.    *    DO use more secure versions of the "r" commands for cases where 
  133.         there is a specific need.
  134.             Wietse Venema's logdaemon package contains a more secure version
  135.             of the "r" command daemons.  These versions can be configured to 
  136.             consult only /etc/hosts.equiv and not $HOME/.rhosts.  There is 
  137.             also an option to disable the use of wildcards ('+').
  138.         Refer to B.13 for access information for the logdaemon package
  139.    *    DO filter ports 512,513 and 514 (TCP) at the router if you do use any
  140.         of the "r" commands.
  141.             This will stop people outside your domain from exploiting these
  142.             commands but will not stop people inside your domain.
  143.             To do this you will need to disable these commands (see 2.2.1).
  144.    *    DO use tcp_wrappers to provide greater access and logging on these
  145.         network services (see 2.12).
  146.  
  147.  2.3  /etc/hosts.equiv
  148.  
  149.   2.3.1 It is recommended that the following action be taken whether or not 
  150.         the "r" commands are in use on your system.
  151.      *    CHECK if the file /etc/hosts.equiv is required.   
  152.               If you are running "r" commands, this file allows other hosts to 
  153.               be trusted by your system.  Programs such as rlogin can then be 
  154.               used to log on to the same account name on your machine from a 
  155.               trusted machine without supplying a password.
  156.               If you are not running "r" commands or you do not wish to 
  157.               explicitly trust other systems, you should have no use for
  158.               this file and it should be removed.  If it does not exist, it 
  159.               cannot cause you any problems if any of the "r" commands are 
  160.               accidentally re-enabled.
  161.  
  162.   2.3.2 If you must have a /etc/hosts.equiv file
  163.      *    ENSURE that you keep only a small number of TRUSTED hosts listed. 
  164.      *    DO use netgroups for easier management if you run NIS (also known 
  165.           as YP) or NIS+.
  166.      *    DO only trust hosts within your domain or under your management.
  167.      *    ENSURE that you use fully qualified hostnames, 
  168.               i.e., hostname.domainname.au
  169.      *    ENSURE that you do NOT have a '+' entry by itself anywhere in the
  170.           file as this may allow any user access to the system.
  171.      *    ENSURE that you do not use '!' or '#' in this file.
  172.               There is no comment character for this file.
  173.      *    ENSURE that the first character of the file is not '-'.  
  174.           Refer to the CERT advisory CA-91:12 (C.8).
  175.      *    ENSURE that the permissions are set to 600.
  176.      *    ENSURE that the owner is set to root.
  177.      *    CHECK it again after each patch or operating system installation.
  178.  
  179.  2.4  /etc/netgroup
  180.    *    If you are using NIS (YP) or NIS+, DO define each netgroup to contain 
  181.         only usernames or only hostnames.
  182.             All utilities parse /etc/netgroup for either hosts or
  183.             usernames, but never both.  Using separate netgroups makes it
  184.             easier to remember the function of each netgroup. The added
  185.             time required to administer these extra netgroups is a small
  186.             cost in ensuring that strange permission combinations have not
  187.             left your machine in an insecure state.
  188.             Refer to the manual pages for more information.
  189.  
  190.  2.5  $HOME/.rhosts
  191.  
  192.   2.5.1 It is recommended that the following action be taken whether or not 
  193.         the "r" commands are in use on your system.
  194.       *     ENSURE that no user has a .rhosts file in their home directory.
  195.                They pose a greater security risk than /etc/hosts.equiv, as one
  196.                can be created by each user.  There are some genuine needs for
  197.                these files, so hear each one on a case-by-case basis; e.g.,
  198.                running backups over a network unattended.
  199.       *     DO use cron to periodically check for, report the contents of 
  200.             and delete $HOME/.rhosts files.  Users should be made aware that 
  201.             you regularly perform this type of audit, as directed by policy.
  202.  
  203.    2.5.2 If you must have such a file
  204.       *    ENSURE the first character of the file is not '-'.  
  205.            Refer to the CERT advisory CA-91:12 (C.8).
  206.       *    ENSURE that the permissions are set to 600.
  207.       *    ENSURE that the owner of the file is the account's owner.
  208.       *    ENSURE that the file does NOT contain the symbol "+" on any line as
  209.            this may allow any user access to this account.
  210.       *    ENSURE that usage of netgroups within .rhosts does not allow
  211.            unintended access to this account.
  212.       *    ENSURE that you do not use '!' or '#' in this file.
  213.               There is no comment character for this file.
  214.       *    REMEMBER that you can also use logdaemon to restrict the use of
  215.            $HOME/.rhosts (see 2.2.2).
  216.  
  217.  2.6  NFS
  218.       When using NFS, you implicitly trust the security of the NFS server
  219.       to maintain the integrity of the mounted files.
  220.    *    DO filter NFS traffic at the router.
  221.             Filter TCP/UDP on port 111 
  222.                    TCP/UDP on port 2049 
  223.             This will prevent machines not on your subnet from accessing
  224.             file systems exported by your machines.
  225.    *    DO apply all available patches.
  226.             NFS has had a number of security vulnerabilities.
  227.    *    DO disable NFS if you do not need it.
  228.             See your vendor supplied documentation for detailed instructions.
  229.    *    DO enable NFS port monitoring.
  230.             Calls to mount a file system will then be accepted from ports < 1024
  231.             only. This will provide added security in some circumstances.
  232.             See your vendor's documentation to determine whether this is an 
  233.             option for your version of UNIX (see also 6.1.8 and 6.2.4).
  234.    *    DO use /etc/exports or /etc/dfs/dfstab to export ONLY the file systems 
  235.         you need to export. 
  236.             If you aren't certain that a file system needs to be exported, 
  237.             then it probably shouldn't be exported.
  238.    *    DO NOT self-reference an NFS server in its own exports file.
  239.             i.e., The exports file should not export the NFS server to
  240.             itself in part or in total.  In particular, ensure the NFS server 
  241.             is not contained in any netgroups listed in its exports file. 
  242.    *    DO NOT allow the exports file to contain a 'localhost' entry.
  243.    *    DO export to fully qualified hostnames only.
  244.             i.e., Use the full machine address 'machinename.domainname.au' and
  245.             do not abbreviate it to 'machinename'.
  246.    *    ENSURE that export lists do not exceed 256 characters.
  247.             If you have access lists of hosts within /etc/exports, the list 
  248.             should not exceed 256 characters AFTER any host name aliases have 
  249.             been expanded.
  250.             Refer to the CERT Advisory CA-94:02 (C.8).
  251.    *    DO run fsirand for all your file systems and rerun it periodically.
  252.             Firstly, ensure that you have installed any patches for fsirand.
  253.             Then ensure the file system is unmounted and run fsirand. 
  254.             Predictable file handles assist crackers in abusing NFS. 
  255.    *    ENSURE that you never export file systems unintentionally to the world.
  256.             Use a -access=host.domainname.au option or equivalent in 
  257.             /etc/exports. 
  258.             See the manual page for "exports" or "dfstab" for further examples.
  259.    *    DO export file systems read-only (-ro) whenever possible.  
  260.             See the manual page for "exports" or "dfstab" for more information.
  261.    *    If NIS is required in your situation, then DO use the secure option in
  262.         the exports file and mount requests (if the secure option is available).
  263.    *    DO use showmount -e to see what you currently have exported.
  264.    *    ENSURE that the permissions of /etc/exports are set to 644.
  265.    *    ENSURE that /etc/exports is owned by root.  
  266.    *    ENSURE that you run a portmapper or rpcbind that does not forward 
  267.         mount requests from clients.
  268.             A malicious NFS client can ask the server's portmapper daemon 
  269.             to forward requests to the mount daemon.  The mount daemon 
  270.             processes the request as if it came directly from the portmapper.
  271.             If the file system is self-mounted this gives the client 
  272.             unauthorised permissions to the file system.
  273.             Refer to section B.14 for how to obtain an alternate portmapper or
  274.             rpcbind that disallow proxy access.
  275.             Refer to the CERT Advisory 94:15 (C.8).
  276.    *    REMEMBER that changes in /etc/exports will take effect only after
  277.         you run /usr/etc/exportfs or equivalent. 
  278.  
  279.    Note: A "web of trust" is created between hosts connected to each other via
  280.          NFS.  That is, you are trusting the security of any NFS server you use.
  281.  
  282.  2.7  /etc/hosts.lpd
  283.    *    ENSURE that the first character of the file is not '-'.  
  284.         (Refer to the CERT advisory CA-91:12 (see C.8)).
  285.    *    ENSURE that the permissions on this file are set to 600.
  286.    *    ENSURE that the owner is set to root.
  287.    *    ENSURE that you do not use '!' or '#' in this file.
  288.             There is no comment character for this file.
  289.  
  290.  2.8  Secure terminals
  291.    *    This file may be called /etc/ttys, /etc/default/login or
  292.         /etc/security.  See the manual pages for file format and usage 
  293.         information.
  294.    *    ENSURE that the secure option is removed from all entries that 
  295.         don't need root login capabilities. 
  296.             The secure option should be removed from console if you do not 
  297.             want users to be able to reboot in single user mode.
  298.             Note: This does not affect usability of the su(1) command.
  299.    *    ENSURE that this file is owned by root.
  300.    *    ENSURE that the permissions on this file are 644.
  301.  
  302.  2.9  Network services
  303.  
  304.   2.9.1  /etc/inetd.conf
  305.     *    ENSURE that the permissions on this file are set to 600.
  306.     *    ENSURE that the owner is root.
  307.     *    DO disable any services which you do not require. 
  308.             - To do this we suggest that you comment out ALL services by 
  309.               placing a "#" at the beginning of each line.  Then enable 
  310.               the ones you NEED by removing the "#" from the beginning 
  311.               of the line.  In particular, it is best to avoid "r" commands 
  312.               and tftp, as they have been major sources of insecurities.  
  313.             - For changes to take effect, you need to restart the inetd 
  314.               process.  Do this by issuing the commands in G.1.  For some 
  315.               systems (including AIX), these commands are not sufficient.
  316.               Refer to vendor documentation for more information.
  317.  
  318.   2.9.2  Portmapper
  319.     *    DO disable any non-required services that are started up in the system 
  320.          startup procedures and register with the portmapper.  See G.2 for a 
  321.          command to help check for registered services.
  322.  
  323.  2.10  Trivial ftp (tftp)
  324.    *    If tftp is not needed, comment it out from the file 
  325.         /etc/inetd.conf and restart the inetd process (as above).
  326.    *    If required, read the AUSCERT Advisory SA-93:05 (see A.1) and follow 
  327.         the recommendations.
  328.  
  329.  2.11  /etc/services
  330.    *    ENSURE that the permissions on this file are set to 644.
  331.    *    ENSURE that the owner is root.
  332.  
  333.  2.12  tcp_wrapper (also known as log_tcp)
  334.    *    ENSURE that you are using this package.
  335.             - Customise and install it for your system.
  336.             - Enable PARANOID mode
  337.             - Consider running with the RFC931 option
  338.             - Deny all hosts by putting "all:all" in /etc/hosts.deny and
  339.               explicitly list trusted hosts who are allowed access to your
  340.               machine in /etc/hosts.allow.
  341.             - See the documentation supplied with this package for details 
  342.               about how to do the above.
  343.    *    DO wrap all TCP services that you have enabled in /etc/inetd.conf
  344.    *    DO consider wrapping any udp services you have enabled.  If you
  345.         wrap them, then you will have to use the nowait option in the 
  346.         /etc/inetd.conf file.
  347.    *    See section B.4 for instructions to obtain tcp_wrapper.
  348.  
  349.  2.13  /etc/aliases
  350.    *    Comment out the "decode" alias by placing a "#" at the beginning
  351.         of the line.  For this change to take effect you will need to run
  352.         /usr/bin/newaliases.  If you run NIS (YP), you will then need to 
  353.         rebuild your maps (see G.3).
  354.    *    ENSURE that all programs executable by an alias are owned by root,
  355.         have permissions 755 and are stored in a systems directory 
  356.         e.g., /usr/local/bin.  If smrsh is in use, program execution may be
  357.         further restricted.  Refer to the smrsh documentation for more details 
  358.         (see B.9).
  359.  
  360.  2.14  Sendmail
  361.    *    DO use the latest version of Eric Allman's sendmail 8.x (currently
  362.         8.7.3), as it currently contains no KNOWN vulnerabilities.  
  363.             The latest version is available via anonymous FTP from: 
  364.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.cs.berkeley.edu
  365.                         /ucb/sendmail
  366.             NOTE: If you don't already run Eric Allman's sendmail.8.7.*,
  367.                   then it may take you some time to build, install, and 
  368.                   configure the system to your needs.  Other sendmail(8) 
  369.                   configuration files may not be compatible with 
  370.                   sendmail(8) 8.7.x.  There is some help available for 
  371.                   converting from SUN's sendmail: bundled with the distribution
  372.                   of sendmail(8) v8.7.x is a document on converting standard 
  373.                   SUN configuration files to sendmail(8) v8.*.  This is located
  374.                   in the distribution, in the file:
  375.                       contrib/converting.sun.configs 
  376.    *    If you use a vendor version of sendmail, ENSURE that you have 
  377.         installed the latest patches as sendmail(8) has been a source of a 
  378.         number of security vulnerabilities.
  379.             Refer to AUSCERT Advisories SA-93:10, AA-95.08 and AA-95.09b (A.1) 
  380.             and CERT Advisories CA-94:12, CA-95:05 and CA-95:08 (C.8).
  381.    *    If you require progmailer functionality then DO use smrsh (see B.9).
  382.    *    If you do not require progmailer functionality then DO disable mail to
  383.         programs by setting this field to /bin/false in the sendmail 
  384.         configuration file.
  385.    *    ENSURE that your version of sendmail does not have the wizard
  386.         password enabled (see G.4).  ENSURE that if you have a line starting 
  387.         with "OW" in /etc/sendmail.cf, it only has a "*" next to it.
  388.    *    DO increase sendmail(8) logging to a minimum log level of 9. 
  389.             This will help detect attempted exploitation of the sendmail(8)
  390.             vulnerabilities.  See G.5 for example commands.
  391.    *    DO increase the level of logging provided by syslog.
  392.             Enable a minimum level of "info" for mail messages to be
  393.             logged to the console and/or the syslog file.  See G.6 for 
  394.             example code and instructions.
  395.    *    REMEMBER that you will need to restart sendmail for any changes to take
  396.         effect.  If you are running a frozen configuration file (sendmail.fc),
  397.         you will need to rebuild it before restarting sendmail(8) (see G.7).
  398.  
  399.  2.15  majordomo
  400.    *    ENSURE that your version is greater than 1.91.
  401.         See AUSCERT Advisory SA-94.03 (see A.1) for more details.
  402.  
  403.  2.16  fingerd
  404.    *    If your version of fingerd is older than than 5 November 1988, DO
  405.         replace it with a newer version.
  406.    *    Finger can provide a would-be intruder with a lot of information
  407.         about your host.  CONSIDER the finger information you provide and
  408.         think about reducing the content by disabling finger or by
  409.         replacing it with a version that only offers restricted information.
  410.         NOTE:  other services such as rusers and netstat may give out similar
  411.                information.
  412.    *    DO NOT use GNU finger v1.37 as it may allow intruders to read any file. 
  413.  
  414.  2.17  UUCP
  415.    *    DO disable the uucp account, including the shell that it executes 
  416.         for logging in, if it is not used at your site.
  417.             uucp may be shipped in a dangerous state.   
  418.    *    REMOVE any .rhosts file at the uucp home directory.
  419.    *    ENSURE that the file L.cmds is owned by root.
  420.    *    ENSURE that no uucp owned files or directories are world writable.
  421.    *    ENSURE that you have assigned a different uucp login for each site
  422.         that needs uucp access to your machine.  
  423.    *    ENSURE that you have limited the number of commands that each uucp 
  424.         login can execute to a bare minimum. 
  425.    *    DO consider deleting the whole uucp subsystem if it is not required.
  426.    *    ENSURE there are no vendor-supplied uucp or root crontab entries.
  427.  
  428.  2.18  REXD
  429.    *   DO disable this service.  
  430.            Comment this out in the inetd.conf file.  See section 2.9.1 for
  431.            details on how to do this.  rexd servers have little or no 
  432.            security in their design or implementation.  Intruders can exploit 
  433.            this service to execute commands as any user.
  434.  
  435.  2.19  World Wide Web (WWW) - httpd
  436.    *   ENSURE that you are using the most recent version of the http daemon 
  437.        of your choice.
  438.    *   DO run the server daemon httpd as a specially created nonprivileged 
  439.        user such as 'httpd'.
  440.            This way, if an intruder finds a vulnerability in the server 
  441.            they will only have access privileges for this unprivileged user.
  442.    *   DO NOT run the server daemon as root.
  443.    *   DO NOT run the client processes as root.
  444.    *   DO run httpd in a chroot(1) environment.
  445.            This sets up an alternate root directory that severely limits
  446.            access of http clients to the rest of the disk.
  447.    *   For systems which do not have a chroot(1) command, use of chrootuid
  448.        (see B.16) may be of assistance.
  449.    *   DO carefully go through the configuration options for your server.
  450.    *   DO use the configuration options to give extra protection to
  451.        sensitive directories by turning off the 'include files' feature.
  452.            This will disallow files from these directories from being
  453.            included in HTML documents.
  454.    *   DO use CGIWRAP.  (See B.17)
  455.    *   DO NOT run CGI (Common Gateway Interface) scripts if they are not 
  456.        required.
  457.    *   DO be very careful in constructing CGI programs.  
  458.             These programs compute information to be returned to clients
  459.             and are often driven by input from the remote user who may be
  460.             hostile.  If these programs are not carefully constructed, it may 
  461.             be possible for remote users to subvert them to execute arbitrary 
  462.             commands on the server system.  Almost all vulnerabilities arise 
  463.             from these issues.
  464.    *   DO provide CGIs as statically linked binaries rather than as interpreted
  465.        scripts.
  466.             This will remove the need for a command interpreter to be   
  467.             available inside the chrooted environment.
  468.    *   ENSURE that the contents, permissions and ownership of files in the 
  469.        cgi-bin directory are what you expect them to be (see your site security
  470.        policy document for more details).
  471.    *   AVOID passing user input directly to command interpreters
  472.        such as Perl, AWK, UNIX shells or programs that allow commands 
  473.        to be embedded in outgoing messages such as /usr/ucb/mail
  474.    *   FILTER user input for potentially dangerous characters before 
  475.        it is passed to any command interpreters. 
  476.              Possibly dangerous characters include \n \r (.,/;~!)>|^&$`< .
  477.              (Refer to the CERT Advisory CA-95:04 (see C.8)).
  478.  
  479. ==============================================================================
  480. 3.0  ftpd and anonymous ftp
  481. ==============================================================================
  482.  3.1  Versions
  483.    *    ENSURE that you are using the most recent version of the ftp daemon 
  484.         of your choice.
  485.    *    DO consider installing the Washington University ftpd if you don't 
  486.         already have it (see B.19).
  487.    *    For BSDI systems, patch 005 should be applied to version 1.1 of the
  488.         BSD/386 software (see B.20).
  489.  
  490.  3.2  Configuration 
  491.    *    CHECK all default configuration options on your ftp server.
  492.    *    ENSURE that your ftp server does not have the SITE EXEC command
  493.         (see G.8 for command details).
  494.    *    ENSURE that you have set up a file /etc/ftpusers which specifies
  495.         those users that are NOT allowed to connect to your ftpd.  
  496.             This should include, as a MINIMUM, the entries: root, bin,
  497.             uucp, ingres, daemon, news, nobody and ALL vendor supplied 
  498.             accounts.
  499.  
  500.  3.3  Anonymous ftp only
  501.    *    To ascertain whether you are running anonymous ftp, try to connect
  502.         to the localhost using anonymous ftp.  Be sure to give an RFC822
  503.         compliant username as the password (see G.9).
  504.    *    To disable anonymous ftp, move or delete all files in ~ftp/ and then 
  505.         remove the user ftp from your password file.        
  506.    *    If you are running distributed passwords (e.g., NIS, NIS+) then you
  507.         will need to check the password entries served to your machine as
  508.         well as those in your local password file.
  509.  
  510.   3.3.1  Configuration of your ftp server
  511.     *    CHECK all default configuration options on your ftp server.
  512.              Not all versions of ftp are configurable.  If you have a 
  513.              configurable version of ftp (e.g., wu-ftp) then make sure that     
  514.              all delete, overwrite, rename, chmod and umask options (there
  515.              may be others) are NOT allowed for guests and anonymous users. 
  516.              In general, anonymous users should not have any unnecessary 
  517.              privileges.
  518.     *    ENSURE that you DO NOT include a command interpreter (such as a shell 
  519.          or tools like perl) in ~ftp/bin, ~ftp/usr/bin, ~ftp/sbin or similar 
  520.          directory configurations that can be executed by SITE EXEC
  521.          (Refer to AUSCERT advisory SA-94.01 (see A.1)).
  522.     *    DO NOT keep system commands in ~ftp/bin, ~ftp/usr/bin, ~ftp/sbin 
  523.          or similar directory configurations that can be executed by SITE EXEC.
  524.             It may be necessary to keep some commands, such as uncompress, in
  525.             these locations.  Consider the inclusion of each command on a case
  526.             by case basis and be aware that the presence of such commands may 
  527.             make it possible for local users to gain unauthorised access.
  528.             Be wary of including commands that can execute arbitrary commands.
  529.             For example, some versions of tar may allow you to execute an
  530.             arbitrary file.
  531.             (Refer to AUSCERT advisory SA-94.01 (see A.1)).
  532.     *    ENSURE that you use an invalid password and user shell for the ftp
  533.          entry in the system password file and the shadow password file (if
  534.          you have one). It should look something like:
  535.             ftp:*:400:400:Anonymous FTP:/home/ftp:/bin/false
  536.          where /home/ftp is the anonymous ftp area.
  537.     *    ENSURE that the permissions of the ftp home directory (~ftp/) are set
  538.          to 555 (read nowrite execute), owner set to root (NOT ftp).
  539.     *    ENSURE that you DO NOT have a copy of your real /etc/passwd file
  540.          as ~ftp/etc/passwd.  
  541.             Create one from scratch with permissions 444, owned by root.  It 
  542.             should not contain the names of any accounts in your real 
  543.             password file.  It should contain only root and ftp.  These 
  544.             should be dummy entries with disabled passwords eg:
  545.                root:*:0:0:Ftp maintainer::  
  546.                ftp:*:400:400:Anonymous ftp::
  547.          The password file is used only to provide uid to username mapping for
  548.          ls(1) listings.
  549.     *    ENSURE that you DO NOT have a copy of your real /etc/group file as 
  550.          ~ftp/etc/group. 
  551.             Create one from scratch with permissions 444, owned by root.  
  552.     *    ENSURE the files ~ftp/.rhosts and ~ftp/.forward do not exist.
  553.     *    DO set the login shell of the ftp account to a non-functional shell
  554.          such as /bin/false.
  555.  
  556.   3.3.2  Permissions
  557.     *    ENSURE NO files or directories are owned by the ftp account or have 
  558.          the same group as the ftp account. 
  559.             If they are, it may be possible for an intruder to replace them 
  560.             with a trojan version.
  561.     *    ENSURE that the anonymous ftp user cannot create files or directories
  562.          in ANY directory unless required (see Section 3.3.3).
  563.     *    ENSURE that the anonymous ftp user can only read information in public
  564.          areas.
  565.     *    ENSURE that the permissions of the ftp home directory (~ftp/) are set
  566.          to 555 (read nowrite execute), owner set to root (NOT ftp).
  567.     *    ENSURE that the system subdirectories ~ftp/etc and ~ftp/bin 
  568.          have the permissions 111 only, owner set to root.
  569.     *    ENSURE that the permissions of files in ~ftp/bin/* have the
  570.          permissions 111 only, owner set to root.
  571.     *    ENSURE that the permissions of files in ~ftp/etc/* are set to
  572.          444, owner set to root.
  573.     *    ENSURE that there is a mail alias for ftp to avoid mail bounces.
  574.     *    ENSURE /usr/spool/mail/ftp is owned by root with permissions 400.
  575.  
  576.   3.3.3  Writable directories
  577.     *    ENSURE that you don't have any writable directories. 
  578.             It is safest not to have any writable directories. If you do 
  579.             have any, we recommend that you limit the number to one.    
  580.     *    ENSURE that writable directories are not also readable.
  581.             Directories that are both writable and readable may be used  
  582.             in an unauthorised manner. 
  583.     *    ENSURE that any writable directories are owned by root and have 
  584.          permissions 1733.  
  585.     *    DO put writable directories on a separate partition if possible. 
  586.             This will help to prevent denial of service attacks. 
  587.     *    DO read Anonymous FTP Configuration Guidelines (see B.21).
  588.  
  589.   3.3.4  Disk mounting
  590.     *    NEVER mount disks from other machines to the ~ftp hierarchy 
  591.          unless they are set read-only in the mount command.  
  592.  
  593. ==============================================================================
  594. 4.0  Password and account security
  595. ==============================================================================
  596.         This section of the checklist can be incorporated as part of a 
  597.         password and account usage policy.
  598.  
  599.  4.1  Policy
  600.    *    ENSURE that you have a password policy for your site. 
  601.             See the AUSCERT Advisory SA-93.04 (see A.1).
  602.    *    ENSURE you have a User Registration Form for each user on each 
  603.         system.  Make sure that this form includes a section that the 
  604.         intending applicant signs, stating that they have read your account
  605.         usage policy and what the consequences are if they misuse their 
  606.         account.
  607.  
  608.  4.2  Proactive Checking
  609.    *    DO use anlpasswd to proactively screen passwords as they are entered.
  610.             This program runs a series of checks on passwords when they are
  611.             set, which assists in avoiding poor passwords.  It works with
  612.             normal, shadow and NIS (or yp) password systems. 
  613.             (Refer to section B.3 for how to obtain it).
  614.    *    DO check passwords periodically with Crack. 
  615.             (Refer to section B.1 for how to obtain Crack).
  616.    *    DO apply password ageing (if possible).
  617.  
  618.  4.3  NIS, NIS+ and /etc/passwd entries
  619.    *    DO NOT run NIS or NIS+ if you don't really need it.
  620.    *    If NIS functionality is required, DO use NIS+ if possible.
  621.    *    ENSURE that the only machines that have a '+' entry in the /etc/passwd
  622.         files are NIS (YP) clients; i.e., NOT the NIS master server!
  623.             There appears to be conflicting documentation and
  624.             implementations regarding the '+' entry format and so a
  625.             generic solution is not available here.  It would be best to
  626.             consult your vendor's documentation.
  627.             Some of the available documentation suggests placing a '*' in
  628.             the password field, which is NOT consistent across all
  629.             implementations of NIS.  We recommend testing your systems on a
  630.             case-by-case basis to see if they correctly implement the '*'
  631.             in the password field.
  632.             See G.10 for instructions.
  633.    *    ENSURE that /etc/rc.local or the equivalent startup procedure is set up
  634.         to start ypbind with the -s option.
  635.             This may not be applicable on all systems.  Check your 
  636.             documentation.
  637.    *    DO use secure RPC.
  638.  
  639.  4.4  Password shadowing 
  640.    *    DO enable vendor supplied password shadowing or a third party 
  641.         product.
  642.             Password shadowing restricts access to users' encrypted passwords.
  643.    *    DO periodically audit your password and shadow password files 
  644.         for unauthorised additions or inconsistencies.
  645.  
  646.  4.5  Administration
  647.    *    ENSURE that you regularly audit your system for dormant accounts
  648.         and disable any that have not been used for a specified period,
  649.         say 3 months.  Send out account renewal notices by post and delete 
  650.         any accounts of users that do not reply.
  651.         [NOTE: Do not email renewal notices because any accounts being used
  652.         illegitimately will reply as expected and hence will not be discovered]
  653.    *    ENSURE that all accounts have passwords.  Check shadow or NIS passwords 
  654.         too, if you have them.
  655.         i.e., the password field is not empty.
  656.    *    ENSURE that any user area is adequately backed up and archived.
  657.    *    DO regularly monitor logs for successful and unsuccessful su(1) 
  658.         attempts.
  659.    *    DO regularly check for repeated login failures.
  660.    *    DO regularly check for LOGIN REFUSED messages.
  661.    *    Consider quotas on user accounts if you do not have them.
  662.    *    Consider requiring that users physically identify themselves before
  663.         granting any requests regarding accounts (e.g., before creating a
  664.         user account).
  665.  
  666.  4.6  Special accounts
  667.    *    ENSURE that there are no shared accounts other than root in accordance
  668.         with site security policy. 
  669.             i.e., more than one person should not know the password to an
  670.             account.
  671.    *    Disable guest accounts.  
  672.             Better yet, do not create guest accounts!
  673.             [NOTE: Some systems come preconfigured with guest accounts]
  674.    *    DO use special groups (such as the "wheel" group under SunOS) to
  675.         restrict which users can use su to become root.
  676.    *    DISABLE ALL default vendor accounts shipped with the Operating System.  
  677.             This should be checked after each upgrade or installation.
  678.    *    DO Disable accounts that have no password which execute a command, for
  679.         example "sync".
  680.             Delete or change ownership of any files owned by these
  681.             accounts.  Ensure that these accounts do not have any cron or
  682.             at jobs. It is best to remove these accounts entirely.
  683.    *    DO assign non-functional shells (such as /bin/false) to system
  684.         accounts such as bin and daemon and to the sync account if it is
  685.         not needed.
  686.    *    DO put system accounts in the /etc/ftpusers file so they cannot use 
  687.         ftp.
  688.             This should include, as a MINIMUM, the entries: root, bin,
  689.             uucp, ingres, daemon, news, nobody and ALL vendor supplied 
  690.             accounts.
  691.  
  692.  4.7  Root account
  693.    *    DO restrict the number of people who know the root password.
  694.             These should be the same users registered with groupid 0
  695.             (e.g., wheel group on SunOS).  Typically this is limited to at most
  696.             3 or 4 people.  
  697.    *    DO NOT log in as root over the network, in accordance with site
  698.         security policy.
  699.    *    DO su from user accounts rather than logging in as root.  
  700.             This provides greater accountability.
  701.    *    ENSURE root does not have a ~/.rhosts file.
  702.    *    ENSURE "." is not in root's search path.
  703.    *    ENSURE root's login files do not source any other files not
  704.         owned by root or which are group or world writable.
  705.    *    ENSURE root cron job files do not source any other files not
  706.         owned by root or which are group or world writable.
  707.    *    DO use absolute path names when root. 
  708.             e.g., /bin/su, /bin/find, /bin/passwd.  This is to stop the
  709.             possibility of root accidentally executing a trojan horse.  To
  710.             execute commands in the current directory, root should prefix
  711.             the command with "./", e.g., ./command.
  712.  
  713.  4.8  .netrc files
  714.    *    DO NOT use .netrc files unless it is absolutely necessary.
  715.    *    If .netrc files must be used, DO NOT store password information in
  716.         them.
  717.  
  718.  4.9  GCOS field
  719.    *    DO include information in the GCOS field of the password file which
  720.         can be used to identify your site if the password file is stolen.
  721.         e.g.,  joe:*:10:10:Joe Bloggs, Organisation X:/home/joe:/bin/sh
  722.  
  723. ==============================================================================
  724. 5.0  File system security
  725. ==============================================================================
  726.  5.1  General
  727.    *    ENSURE that there are no .exrc files on your system that have
  728.         no legitimate purpose.
  729.    *    DO consider using the EXINIT environment variable to disable .exrc
  730.         file functionality.
  731.             These files may inadvertently perform commands that may compromise
  732.             the security of your system if you happen to start either vi(1) or
  733.             ex(1) in a directory which contains such a file.  
  734.         See G.11 for example commands to find .exrc files.
  735.    *    ENSURE that any .forward files in user home directories do not 
  736.         execute an unauthorised command or program.
  737.             The mailer may be fooled into allowing a normal user privileged 
  738.             access.  Authorised programs may be restricted through use of 
  739.             smrsh (see B.9).
  740.         See G.12 for example commands to find .forward files.
  741.         (Refer to AUSCERT Advisory SA-93.10 (see A.1)).
  742.  
  743.  5.2  Startup and shutdown scripts
  744.    *    ENSURE startup and shutdown scripts do not chmod 666 motd.  
  745.             This allows users to change system message for the day.
  746.    *    ENSURE that the line "rm -f /tmp/t1" (or similar) exists in a startup 
  747.         script to clean up the temporary file used to create /etc/motd.  This 
  748.         should occur BEFORE the code to startup the local daemons.
  749.  
  750.  5.3  /usr/lib/expreserve
  751.    *    DO replace versions of /usr/lib/expreserve prior to July 1993 
  752.         with a recommended patch from your vendor.  
  753.             If this is not possible, then remove execute permission on
  754.             /usr/lib/expreserve (see G.13).
  755.             This will mean that users who edit their files with either vi(1)
  756.             or ex(1) and have their sessions interrupted, will not be able to
  757.             recover their lost work.  If you implement the above
  758.             workaround, please advise your users to regularly save their
  759.             editing sessions.
  760.             (Refer to the CERT advisory CA-93:09 for advice on fixing this
  761.             problem for the SunOS and Solaris environments).
  762.  
  763.  5.4  External file systems/devices
  764.    *    DO mount file systems non-setuid and read-only where practical.
  765.         (Refer to section 2.6)
  766.  
  767.  5.5  File Permissions 
  768.    *    ENSURE that the permissions of /etc/utmp are set to 644.
  769.    *    ENSURE that the permissions of /etc/sm and /etc/sm.bak are set to 2755.
  770.    *    ENSURE that the permissions of /etc/state are set to 644.
  771.    *    ENSURE that the permissions of /etc/motd and /etc/mtab are set to 644.
  772.    *    ENSURE that the permissions of /etc/syslog.pid are set to 644.
  773.             [NOTE: this may be reset each time you restart syslog.]
  774.    *    DO consider removing read access to files that users do not need to 
  775.         access.
  776.    *    ENSURE that the kernel (e.g., /vmunix) is owned by root, has group set 
  777.         to 0 (wheel on SunOS) and permissions set to 644.
  778.    *    ENSURE that /etc, /usr/etc, /bin, /usr/bin, /sbin, /usr/sbin, /tmp and 
  779.         /var/tmp are owned by root and that the sticky-bit is set on /tmp and on
  780.         /var/tmp (see G.14).  Refer to the AUSCERT Advisory AA-95:05 (see A.1).
  781.    *    ENSURE that there are no unexpected world writable files or 
  782.         directories on your system.  
  783.         See G.15 for example commands to find group and world writable files
  784.         and directories.                           
  785.    *    CHECK that files which have the SUID or SGID bit enabled, should have
  786.         it enabled (see G.16).
  787.    *    ENSURE the umask value for each user is set to something sensible 
  788.         like 027 or 077. 
  789.         (Refer to section E.1 for a shell script to check this).
  790.    *    ENSURE all files in /dev are special files.
  791.             Special files are identified with a letter in the first position of
  792.             the permissions bits.  See G.17 for a command to find files in 
  793.             /dev which are not special files or directories.
  794.             Note: Some systems have directories and a shell script in /dev which
  795.             may be legitimate.  Please check the manual pages for more 
  796.             information.
  797.    *    ENSURE that there are no unexpected special files outside /dev.
  798.         See G.18 for a command to find any block special or character
  799.         special files.
  800.  
  801.  5.6  Files run by root
  802.         AUSCERT recommends that anything run by root should be owned by
  803.         root, should not be world or group writable and should be located 
  804.         in a directory where every directory in the path is owned by root 
  805.         and is not group or world writable.
  806.    *    CHECK the contents of the following files for the root account.
  807.             Any programs or scripts referenced in these files should meet
  808.             the above requirements:
  809.             -  ~/.login, ~/.profile and similar login initialisation files
  810.             -  ~/.exrc and similar program initialisation files
  811.             -  ~/.logout and similar session cleanup files
  812.             -  crontab and at entries
  813.             -  files on NFS partitions 
  814.             -  /etc/rc* and similar system startup and shutdown files
  815.    *    If any programs or scripts referenced in these files source further 
  816.         programs or scripts they also need to be verified.
  817.  
  818.  5.7  Bin ownership
  819.         Many systems ship files and directories owned by bin (or sys).  This 
  820.         varies from system to system and may have serious security implications.
  821.    *    CHANGE all non-setuid files and all non-setgid files and directories 
  822.         that are world readable but not world or group writable and that are 
  823.         owned by bin to ownership of root, with group id 0 (wheel group under 
  824.         SunOS 4.1.x).
  825.             - Please note that under Solaris 2.x changing ownership of system 
  826.               files can cause warning messages during installation of patches 
  827.               and system packages.
  828.             - Anything else should be verified with the vendor.
  829.  
  830.  5.8  Tiger/COPS
  831.    *    Do run one or both of these.                         
  832.             Many of the checks in this section can be automated by using
  833.             these programs. 
  834.    *    To obtain these programs, see B.2.
  835.  
  836.  5.9  Tripwire
  837.    *    DO run statically linked binary
  838.    *    DO store the binary, the database and the configuration file on 
  839.         hardware write-protected media.
  840.    *    To obtain this program, see B.5.
  841.  
  842. ==============================================================================
  843. 6.0  Vendor operating system specific security
  844. ==============================================================================
  845.         The following is a list of security issues that relate to specific
  846.         UNIX operating systems.  This is not necessarily a complete list
  847.         of available UNIX types or of problems for those that are listed.
  848.  
  849.  6.1  SunOS 4.1.x
  850.  
  851.   6.1.1 Patches
  852.     * DO regularly ask your vendor for a complete list of patches.  Sun
  853.       regularly updates a list of recommended and security patches, which 
  854.       is available from:
  855.             ftp://ftp.auscert.org.au/pub/mirrors/sunsolve1.sun.com/*
  856.         or
  857.             ftp://sunsolve1.sun.com/pub/patches/*
  858.  
  859.   6.1.2 IP forwarding and source routing
  860.     This is particularly relevant if you are using your SUN box as a bastion
  861.     host or duel homed system.
  862.     *    ENSURE IP forwarding is disabled.
  863.             You will need the following line in the kernel configuration
  864.             file: 
  865.                 options "IPFORWARDING=-1" 
  866.             For information on how to customise a kernel, see the file: 
  867.                 /usr/sys/`arch`/conf/README
  868.     *    DO also consider disabling source routing.
  869.             Leaving source routing  enabled may allow unauthorised traffic
  870.             through.  Unfortunately there is no official method or patch
  871.             for turning source routing off.  There is however an
  872.             unsupported patch.  It is available via anonymous ftp from
  873.         ftp://ftp.auscert.org.au/pub/mirrors/ftp.greatcircle.com/v03.n153.Z
  874.  
  875.   6.1.3 Framebuffers  /dev/fb   
  876.     If somebody can log in to your Sun workstation from a remote source, they 
  877.     can read the contents of your Framebuffer, which is /dev/fb. Sun provides 
  878.     a mechanism which allows the user logging in on the console to have 
  879.     exclusive access to the Framebuffer, by using the file /etc/fbtab. 
  880.     A sample /etc/fbtab file:
  881.         #
  882.         # File:         /etc/fbtab
  883.         # Purpose:      Specifies that upon login  to  /dev/console,  the
  884.         #               owner,  group  and permissions of all supported 
  885.         #               devices, including the framebuffer, will be set to 
  886.         #               the user's username, the user's group and 0600.
  887.         # Comments:     SunOS specific.
  888.         # Note:         You cannot use \ to continue a line.
  889.         #
  890.         # Format:
  891.         # Device        Permission      Colon separated device list.
  892.         #
  893.         /dev/console    0600            /dev/fb
  894.         /dev/console    0600            /dev/bwone0:/dev/bwtwo0
  895.         /dev/console    0600            /dev/cgone0:/dev/cgtwo0:/dev/cgthree0
  896.         /dev/console    0600            /dev/cgfour0:/dev/cgsix0:/dev/cgeight0
  897.         /dev/console    0600            /dev/cgnine0:/dev/cgtwelve0
  898.         #
  899.         /dev/console    0600            /dev/kb:/dev/mouse
  900.         /dev/console    0600            /dev/fd0c:/dev/rfd0c
  901.     After the above file has been created, reboot your machine, or log out 
  902.     fully, then log back in again.
  903.     Read the man page for fbtab(5) for more information.
  904.     *    The login replacement from Wietse Venema's logdaemon package 
  905.          supports a similar feature.
  906.          (Refer to B.13 for information on how to retrieve the logdaemon
  907.              package)
  908.              
  909.   6.1.4 /usr/kvm/sys/*
  910.     *    ENSURE all files and directories under /usr/kvm/sys/ are not
  911.         writable by group.  
  912.             In SunOS 4.1.4 the default mode is 2775 with group staff,
  913.             allowing users in group staff to trojan the kernel.
  914.  
  915.   6.1.5 /usr/kvm/crash
  916.     *    REMOVE setgid privileges on /usr/kvm/crash with the command:
  917.                 # /bin/chmod g-s /usr/kvm/crash
  918.             A group of kmem allows users to read the virtual memory of a 
  919.             running system.
  920.  
  921.   6.1.6 /dev/nit (Network Interface Tap)
  922.     *    DO run the CERT tool cpm to check if your system is running in 
  923.          promiscuous mode.
  924.             For access details for cpm see B.6.
  925.     *    DO disable the /dev/nit interface if you do not need to run in
  926.          promiscuous mode.
  927.           - For SunOS 4.x and Solbourne systems, the promiscuous interface 
  928.             to the network can be eliminated by removing the /dev/nit
  929.             capability from the kernel.  Once the procedure is complete, you
  930.             may remove the device file /dev/nit since it is no longer 
  931.             functional.
  932.           - Apply "method 1" as outlined in the System and Network
  933.             Administration manual, in the section, "Sun System
  934.             Administration Procedures," Chapter 9, "Reconfiguring the
  935.             System Kernel."  Excerpts from the method are reproduced below:
  936.                   # cd /usr/kvm/sys/sun[3,3x,4,4c]/conf
  937.                   # cp CONFIG_FILE SYS_NAME
  938.             [NOTE: that at this step, you should replace the CONFIG_FILE
  939.             with your system specific configuration file if one exists.]
  940.  
  941.                   # chmod +w SYS_NAME
  942.                   # vi SYS_NAME
  943.                   #
  944.                   # The following are for streams NIT support.  NIT is used by
  945.                   # etherfind, traffic, rarpd, and ndbootd.  As a rule of thumb,
  946.                   # NIT is almost always needed on a server and almost never
  947.                   # needed on a diskless client.
  948.                   #
  949.                   pseudo-device   snit            # streams NIT
  950.                   pseudo-device   pf              # packet filter
  951.                   pseudo-device   nbuf            # NIT buffering module
  952.  
  953.             [Comment out the 3 "pseudo-device" lines; save and exit the
  954.             editor before proceeding.]
  955.  
  956.                   # config SYS_NAME
  957.                   # cd ../SYS_NAME
  958.                   # make
  959.                   # mv /vmunix /vmunix.old
  960.                   # cp vmunix /vmunix
  961.                   # /etc/halt
  962.                   > b                                          
  963.            
  964.             [This step will reboot the system with the new kernel.]
  965.             [NOTE: that even after the new kernel is installed, you need to
  966.             take care to ensure that the previous vmunix.old , or other
  967.             kernel, is not used to reboot the system.]
  968.          See CERT Advisory CA_94.01 (see C.8)             
  969.  
  970.   6.1.7 Loadable drivers option
  971.     *    DO remove the option for loadable modules from the kernel.  
  972.            This will mean that a rebuild of the kernel and a reboot will be 
  973.            necessary in order to load any additional kernel modules and 
  974.            intruders will be prevented from being able to load extra kernel 
  975.            modules dynamically.  To remove this option, comment out the line
  976.               options        VDDRV           # loadable modules
  977.            from the kernel configuration file and re-compile the kernel.
  978.            NOTE: Some software may expect to be able to load additional modules 
  979.                  such as device drivers.
  980.            NOTE: Even after the new kernel is installed, you need to take care 
  981.                  to ensure that the previous vmunix.old , or other kernel, is 
  982.                  not used to reboot the system.
  983.  
  984.   6.1.8 NFS port monitoring
  985.     *    DO enable NFS port monitoring (see also section 2.6).
  986.            Add the following commands to /etc/rc.local:
  987.                /bin/echo "nfs_portmon/W1" | /bin/adb -w /vmunix /dev/kmem > \
  988.                  /dev/null 2>&1
  989.                rpc.mountd
  990.             
  991.  6.2  Solaris 2.x
  992.  
  993.   6.2.1 Patches
  994.     *    DO regularly ask your vendor for a complete list of patches.  Sun
  995.          regularly updates a list of recommended and security patches, which 
  996.          is available from:
  997.             ftp://ftp.auscert.org.au/pub/mirrors/sunsolve1.sun.com/*
  998.           or
  999.             ftp://sunsolve1.sun.com/pub/patches/*
  1000.  
  1001.   6.2.2 IP forwarding and source routing
  1002.     This is particularly relevant if you are using your SUN box as a bastion
  1003.     host or duel homed system.
  1004.     *    DO disable IP forwarding and source routing.
  1005.             To do this you will need to edit the file /etc/rc.2.d/S69.inet
  1006.             and set the options ip_forwarding and ip_ip_forward_src_routed
  1007.             to zero as illustrated below:
  1008.                 ndd -set /dev/ip ip_forwarding 0
  1009.                 ndd -set /dev/ip ip_ip_forward_src_routed 0
  1010.             For the changes to take effect you will then need to reboot.
  1011.  
  1012.   6.2.3 Framebuffers  /dev/fbs  
  1013.     *        Solaris versions 2.3 and above have a protection facility for
  1014.              framebuffers which is a superset of the functionality provided
  1015.              by /etc/fbtab in SunOS 4.1.x.  
  1016.     *        Under Solaris, /dev/fbs is a directory that contains links to
  1017.              the framebuffer devices.  The /etc/logindevperm file contains
  1018.              information that is used by login(1) and ttymon(1M) to change
  1019.              the owner, group, and permissions of devices upon logging into
  1020.              or out of a console device.  By default, this file contains
  1021.              lines for the keyboard, mouse, audio, and frame buffer devices.
  1022.  
  1023.              A sample /etc/logindevperm file:
  1024.              #
  1025.              # File:     /etc/logindevperm
  1026.              # Purpose:  Specifies that upon login to /dev/console, the
  1027.              #           owner, group and permissions of all supported 
  1028.              #           devices, including the framebuffer, will be set to 
  1029.              #          the user's username, the user's group and 0600.
  1030.              # Comments:        SunOS specific.
  1031.              # Note:    You cannot use \ to continue a line.
  1032.              #
  1033.              # Format:
  1034.              # Device    Permission     Colon separated device list.
  1035.              #
  1036.              /dev/console   0600        /dev/kbd:/dev/mouse
  1037.              /dev/console   0600        /dev/sound/*         # audio devices
  1038.              /dev/console   0600        /dev/fbs/*           # frame buffers
  1039.             
  1040.              Read the man page for logindevperm(4) for more information.
  1041.  
  1042.   6.2.4 NFS port monitoring
  1043.     *    DO enable NFS port monitoring.
  1044.             To do this add the following lines to /etc/system:
  1045.                  set nfs:nfs_portmon = 1
  1046.               or in Solaris version 2.5
  1047.                  set nfssrv:nfs_portmon = 1
  1048.     *   See also section 2.6.
  1049.  
  1050.  6.3  IRIX
  1051.    *    DO regularly ask your vendor for a complete list of patches.  
  1052.    *    Some IRIX patches are available via anonymous ftp from:
  1053.             ftp://ftp.auscert.org.au/pub/mirrors/ftp.sgi.com/security/*
  1054.           or
  1055.             ftp://ftp.auscert.org.au/pub/mirrors/sgigate.sgi.com/*
  1056.    *    DO read the FAQ on IRIX security.
  1057.             A copy can be obtained via anonymous ftp from
  1058.             ftp://ftp.auscert.org.au/pub/mirrors/ftp.uu.net/sgi/security.Z
  1059.    *    For systems which do not have the chroot(1) command, use of
  1060.         chrootuid (see B.16) may be of assistance.
  1061.    *    DO use the software tool rscan.  
  1062.             It checks for many common IRIX-specific security vulnerabilities 
  1063.             and problems. (Refer to B.11 for information on where to
  1064.             get a copy of rscan)
  1065.  
  1066.  6.4  AIX
  1067.    *    DO regularly ask your vendor for a complete list of patches.
  1068.    *    Some AIX patches are available via anonymous ftp from:
  1069.             ftp://ftp.auscert.org.au/pub/mirrors/software.watson.ibm.com
  1070.                         /aix-patches
  1071.  
  1072.  6.5  HP/UX
  1073.    *    DO regularly ask your vendor for a complete list of patches.  
  1074.         HP has set up an automatic server to allow patches and other security
  1075.         information to be retrieved via email.  Email should be sent to the
  1076.         address
  1077.                 support@support.mayfield.hp.com.  
  1078.         The subject line of the message will be ignored. The body (text) of 
  1079.         the message should be of the format
  1080.  
  1081.                 send XXXX
  1082.  
  1083.         where XXXX is the identifier for the information you want retrieved.  
  1084.         For example, to retrieve the patch PHSS_4834, the message would be 
  1085.                 send PHSS_4834.
  1086.         To receive the HP SupportLine mail service user's guide 
  1087.                 send guide.txt
  1088.         To receive the readme file for a patch 
  1089.                 send doc PHSS_4834
  1090.         To receive the original HP bulletin 
  1091.                 send doc HPSBUX9410-018.
  1092.  
  1093.         HP also has a World Wide Web server to browse and retrieve bulletins 
  1094.         and patches.  The URL is:
  1095.                 http://support.mayfield.hp.com/
  1096.  
  1097.  6.6  OSF
  1098.    *    DO regularly ask your vendor for a complete list of patches.   
  1099.         Some patches are available from:
  1100.             ftp://ftp.auscert.org.au/pub/mirrors/ftp.service.digital.com
  1101.                         /osf/<v>/ssrt*
  1102.           or
  1103.             ftp://ftp.service.digital.com/pub/osf/<v>/ssrt*
  1104.         where <v> is the version of the operating system that you run.
  1105.  
  1106.  6.7  ULTRIX
  1107.    *    DO regularly ask your vendor for a complete list of patches.  
  1108.         Some patches are available from:
  1109.             ftp://ftp.auscert.org.au/pub/mirrors/ftp.service.digital.com
  1110.                         /ultrix/<p>/<v>/ssrt*
  1111.           or
  1112.             ftp://ftp.service.digital.com/pub/ultrix/<p>/<v>/ssrt*
  1113.         where <p> is either mips or vax; and
  1114.         where <v> is the version of the operating system that you run.
  1115.  
  1116. ==============================================================================
  1117. 7.0  Security and the X Window System
  1118. ==============================================================================
  1119.         Access to your X server may be controlled through either a host-
  1120.         based or user-based method.  The former is left to the discretion
  1121.         of the Systems Administrator at your site and is useful as long as
  1122.         all hosts registered in the /etc/Xn.hosts file have users that can be
  1123.         trusted, where "n" represents your X server's number.
  1124.  
  1125.         This may not be possible at every site, so a better method is
  1126.         to educate each and every user about the security implications
  1127.         (see references below).  Better still, when setting up a user, give
  1128.         them a set of X security related template files, such as .xserverrc 
  1129.         and .xinitrc. These are located in the users home directory.
  1130.  
  1131.         You are strongly advised to read the section on X window system 
  1132.         security referred to in the X Window System Administrators Guide (C.4).
  1133.  
  1134.  7.1  Problems with xdm
  1135.         Note: Release 6 of X11 is now available and solves many problems
  1136.         associated with X security which were present in previous releases.  
  1137.         If possible, obtain the source for R6 and compile and install it on 
  1138.         your system.  See B.18 for how to retrieve the source for X11R6.
  1139.    *    xdm bypasses the normal getty and login functions, which means that 
  1140.         quotas for the user, ownership of /dev/console and possibly other
  1141.         preventive measures put in place by you may be ignored. 
  1142.    *    You should consult your vendor and ask about potential security holes
  1143.         in xdm and what fixes are available.
  1144.    *    If you are running a version of xdm earlier than October 1995 then 
  1145.         you should update to a newer version.
  1146.         (Refer to CERT Vendor-Initiated Bulletin VB-95:08, see C.8)
  1147.  
  1148.  7.2  X security - General
  1149.    *    DO Read the man pages for xauth and Xsecurity.
  1150.             Use this information to set up the security level you require.
  1151.    *    ENSURE that the permissions on /tmp are set to 1777 (or drwxrwxrwt).
  1152.             i.e., the sticky bit should be set.  The owner MUST always be
  1153.             root and group ownership should be set to group-id 0, which is
  1154.             "wheel" or "system".
  1155.             -  If the sticky bit is set, no one other than the owner can 
  1156.                delete the file /tmp/.X11-unix/X0, which is a socket for your 
  1157.                X server.  Once this file is deleted, your X server will no 
  1158.                longer be accessible.
  1159.             -  See G.14 for example commands to set the correct permissions 
  1160.                and ownership for /tmp.
  1161.     *   DO use the X magic cookie mechanism MIT-MAGIC-COOKIE-1 or better. 
  1162.             With logins under the control of xdm (see 7.1), you can turn on 
  1163.             authentication by editing the xdm-config file and setting  the
  1164.             DisplayManager*authorize attribute to true.  
  1165.             When granting access to the screen from another machine, use
  1166.             the xauth command in preference to the xhost command.
  1167.     *   DO not permit access from arbitrary hosts.
  1168.             Remove all instances of the 'xhost +' command from the
  1169.             system-wide  Xsession file, from user .xsession files, and from
  1170.             any application programs or shell scripts that use the X window
  1171.             system. 
  1172.             
  1173. ==============================================================================
  1174. Appendix A:  Other AUSCERT information sources
  1175.  
  1176. A.1     AUSCERT advisories and alerts
  1177.             Past AUSCERT advisories and alerts can be retrieved via anonymous 
  1178.             ftp from
  1179.                 ftp://ftp.auscert.org.au/pub/auscert/advisory/ 
  1180.  
  1181. A.2     AUSCERT's World Wide Web server
  1182.             AUSCERT maintains a World Wide Web server.  Its URL is
  1183.                 http://www.auscert.org.au
  1184.  
  1185. A.3     AUSCERT's ftp server
  1186.             AUSCERT maintains an ftp server with an extensive range of
  1187.             tools and documents.  Please browse through it.  Its URL is
  1188.                 ftp://ftp.auscert.org.au/pub/
  1189.  
  1190. ==============================================================================
  1191. Appendix B:   Useful security tools
  1192.  
  1193.         There are many good tools available for checking your system.
  1194.         The list below is not a complete list, and you should NOT rely on 
  1195.         these to do ALL of your work for you.  They are intended to be only 
  1196.         a guide.  It is envisaged that you may write some site specific tools
  1197.         to supplement these.  It is also envisaged that you may look around
  1198.         on ftp servers for other useful tools.
  1199.  
  1200.         AUSCERT has not formally reviewed, evaluated or endorsed the tools
  1201.         described.  The decision to use the tools described is the
  1202.         responsibility of each user or organisation.
  1203.  
  1204. B.1     Crack
  1205.             Crack is a fast password cracking program designed to assist site 
  1206.             administrators in ensuring that users use effective passwords.
  1207.             Available via anonymous ftp from:
  1208.                 ftp://ftp.auscert.org.au/pub/cert/tools/crack/*
  1209.  
  1210. B.2     COPS and Tiger
  1211.             These packages identify common security and configuration
  1212.             problems.  They also check for common signs of intrusion. 
  1213.             Though there is some overlap between these two packages, they
  1214.             are different enough that it may be useful to run both. Both 
  1215.             are available via anonymous ftp.
  1216.             COPS:
  1217.                 ftp://ftp.auscert.org.au/pub/cert/tools/cops/1.04
  1218.             tiger:
  1219.                 ftp://ftp.auscert.org.au/pub/mirrors/net.tamu.edu/tiger*
  1220.  
  1221. B.3     anlpasswd
  1222.             This program is a proactive password checker.  It runs a
  1223.             series of checks on passwords at the time users set them and
  1224.             refuses password that fail the tests.  It is designed to work 
  1225.             with shadow password systems.  It is available via anonymous ftp
  1226.             from:
  1227.                 ftp://ftp.auscert.org.au/pub/mirror/info.mcs.anl.gov/*
  1228.  
  1229. B.4     tcp_wrapper
  1230.             This software gives logging and access control to most network
  1231.             services.  It is available via anonymous ftp from:
  1232.                 ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
  1233.                         /tcp_wrappers_7.2.tar.gz
  1234.         
  1235. B.5     Tripwire
  1236.             This package maintains a checksum database of important system
  1237.             files.  It can serve as an early intrusion detection system. It
  1238.             is available via anonymous ftp from:
  1239.                 ftp://ftp.auscert.org.au/pub/coast/COAST/Tripwire/*
  1240.  
  1241. B.6     cpm 
  1242.             cpm checks to see if your network interfaces are running in 
  1243.             promiscuous mode.  If you do not normally run in this state then 
  1244.             it may be an indication that an intruder is running a network 
  1245.             sniffer on your system.  This program was designed to run on 
  1246.             SunOS 4.1.x and may also work on many BSD systems.  It is available 
  1247.             via anonymous ftp from:
  1248.                ftp://ftp.auscert.edu.au/pub/cert/tools/cpm/*
  1249.  
  1250. B.8     Vendor supplied security auditing packages
  1251.             Sun provides an additional security package called SUNshield. 
  1252.             Please direct enquiries about similar products to your vendor.
  1253.  
  1254. B.9     smrsh 
  1255.             The smrsh(8) program is intended as a replacement for /bin/sh
  1256.             in the program mailer definition of sendmail(8).  smrsh is a
  1257.             restricted shell utility that provides the ability to specify,
  1258.             through a configuration, an explicit list of executable
  1259.             programs.  When used in conjunction with sendmail, smrsh
  1260.             effectively limits sendmail's scope of program execution to
  1261.             only those programs specified in smrsh's configuration.        
  1262.             It is available via anonymous ftp from:
  1263.                ftp://ftp.auscert.org.au/pub/cert/tools/smrsh
  1264.  
  1265.             Note: smrsh comes bundled with Eric Allman's sendmail 8.7.1 and
  1266.             higher.
  1267.  
  1268. B.10    MD5
  1269.             MD5 is a message digest algorithm.  An implementation of this is 
  1270.             available via anonymous ftp from:
  1271.                ftp://ftp.auscert.org.au/pub/cert/tools/md5/*
  1272.               
  1273. B.11    rscan
  1274.             This tool checks for a number of common IRIX-specific security 
  1275.             bugs and problems. It is available via anonymous ftp from:
  1276.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.vis.colostate.edu
  1277.                         /rscan/*  
  1278.  
  1279. B.12    SATAN
  1280.             SATAN (Security Administrator Tool for Analysing Networks) is
  1281.             a testing and reporting tool that collects information about
  1282.             networked hosts.  It can also be run to check for a number
  1283.             of vulnerabilities accessible via the network.  It is available
  1284.             via anonymous ftp from:
  1285.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl/satan*
  1286.  
  1287. B.13   logdaemon
  1288.             Written by Wietse Venema, this package includes replacements
  1289.             for rsh and rlogin daemons.  By default these versions do not
  1290.             accept wild cards in host.equiv or .rhost files.  They also
  1291.             have an option to disable user .rhost files.  logdaemon is
  1292.             available via anonymous ftp from:
  1293.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl/logdaemon*
  1294.  
  1295. B.14    portmapper/rpcbind
  1296.             These are portmapper/rpcbind replacements written by Wietse
  1297.             Venema that disallow proxy access to the mount daemon via the 
  1298.             portmapper.  Choose the one suitable for your system.  They are 
  1299.             available via anonymous ftp from:         
  1300.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
  1301.                                         /portmap_3.shar.Z
  1302.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
  1303.                                         /rpcbind_1.1.tar.Z
  1304.  
  1305. B.15    PGP Pretty Good Privacy implements encryption and authentication. 
  1306.             It is available from:
  1307.                ftp://ftp.ox.ac.uk/pub/pgp/unix/
  1308.  
  1309.  
  1310. B.16    chrootuid
  1311.             Allows chroot functionality.  The current version is 1.2 (at
  1312.             time of writing).  Please check for later versions.
  1313.             It is available from:
  1314.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
  1315.                                         /chrooduid1.2
  1316.             A digital signature is available from:
  1317.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.win.tue.nl
  1318.                                         /chrooduid1.2.asc
  1319.  
  1320. B.17    CGIWRAP
  1321.             It is available from:
  1322.                ftp://ftp.cc.umr.edu/pub/cgi/cgiwrap
  1323.  
  1324. B.18    X11R6
  1325.             It is available from:
  1326.                ftp://archie.au/X11/R6/*
  1327.                ftp://archie.au/X11/contrib/*
  1328.              or
  1329.                ftp://ftp.x.org/pub/R6/*
  1330.            
  1331. B.19    Washington University ftpd (wu-ftpd)
  1332.             This can log all events and provide users with a login banner
  1333.             and provide writable directory support in a more secure manner.  
  1334.             It is available from:
  1335.                ftp://ftp.auscert.org.au/pub/mirrors/wuarchive.wustl.edu
  1336.                         /packages/wuarchive-ftpd/*
  1337.  
  1338.         NOTE:  Do not install any versions prior to wu-ftp 2.4 as these are 
  1339.                extremely insecure and in some cases have been trojaned.
  1340.                Refer to the CERT advisory CA-94:07 (C.8).  
  1341.  
  1342. B.20    Patch 005 for BSD/386 v1.1.  
  1343.             It is available from:
  1344.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.bsdi.com
  1345.                         /bsdi/patches/README
  1346.                ftp://ftp.auscert.org.au/pub/mirrors/ftp.bsdi.com
  1347.                         /bsdi/patches/?U110-005
  1348.              or
  1349.                ftp://ftp.bsdi.com/bsdi/patches/README
  1350.                ftp://ftp.bsdi.com/bsdi/patches/?U110-005
  1351.                (where ? is B or S for the Binary or Source version)
  1352.  
  1353. B.21    Anonymous FTP Configuration Guidelines
  1354.             The CERT document which addresses the many problems associated 
  1355.             with writable anonymous ftp directories.  It is available from:
  1356.                ftp://ftp.auscert.org.au/pub/cert/tech_tips/anonymous_ftp
  1357.  
  1358. ==============================================================================
  1359. Appendix C:     References
  1360.  
  1361. C.1     Practical UNIX Security
  1362.         Simson Garfinkel and Gene Spafford
  1363.         (C) 1991 O'Reilly & Associates, Inc.
  1364.  
  1365. C.2     UNIX Systems Security
  1366.         Patrick Wood and Stephen Kochan
  1367.         (C) 1986 Hayden Books
  1368.  
  1369. C.3     UNIX system security: A Guide for Users and System Administrators
  1370.         David A. Curry
  1371.         Addison-Wesley Professional Computing Series
  1372.         May 1992.
  1373.  
  1374. C.4     X Window System Administrators Guide
  1375.         Chapter 4
  1376.         (C) 1992 O'Reilly & Associates, Inc.
  1377.  
  1378. C.5     Information Security Handbook
  1379.         William Caelli, Dennis Longley and Michael Shain
  1380.         (C) 1991 MacMillan Publishers Ltd.
  1381.  
  1382. C.6     Firewalls and Internet Security
  1383.         William R. Cheswick & Steven M. Bellovin
  1384.         (C) 1994 AT&T Bell Laboratories
  1385.         Addison-Wesley Publishing Company
  1386.  
  1387. C.7     Building Internet Firewalls
  1388.         Brent Chapman and Elizabeth Zwicky
  1389.         (C) 1995 O'Reilly & Associates, Inc.
  1390.  
  1391. C.8     CERT advisories are available via anonymous FTP from
  1392.            ftp://ftp.auscert.org.au/pub/cert/cert_advisories/*
  1393.         CERT vendor-initiated bulletins are available via anonymous FTP from
  1394.            ftp://ftp.auscert.org.au/pub/cert/cert_bulletins/*
  1395.  
  1396. C.9     UNIX System Administration Handbook (second edition)
  1397.         Evi Nemeth, Garth Snyder, Trent R. Hein and Scott Seebas
  1398.         Prentice-Hall, Englewood Cliffs (NJ), 1995
  1399.  
  1400. C.10    Essential System Administration
  1401.         Aeleen Frisch
  1402.         O'Reilly & Associates, Inc.
  1403.  
  1404. C.11    Managing Internet Information Services
  1405.         Cricket Liu, Jerry Peek, Russ Jones, Bryan Buus, Adrian Nye
  1406.         O'Reilly & Associates, Inc.
  1407.  
  1408. C.12    Managing NFS and NIS
  1409.         Hal Stern, O'Reilly and Associates, Inc., 1991
  1410.         
  1411. ==============================================================================
  1412. Appendix D: Abbreviated Checklist
  1413.  
  1414.         It is intended that this short version of the checklist be used in
  1415.         conjunction with the full checklist as a progress guide (mark off the
  1416.         sections as you go so that you remember what you have done so far).
  1417.  
  1418. 1.0   Patches
  1419.  [ ]    Installed latest patches?
  1420.  
  1421. 2.0   Network security
  1422.  [ ]    Filtering
  1423.  [ ]    "r" commands
  1424.  [ ]    /etc/hosts.equiv
  1425.  [ ]    /etc/netgroup
  1426.  [ ]    $HOME/.rhosts
  1427.  [ ]    NFS
  1428.  [ ]    /etc/hosts.lpd
  1429.  [ ]    Secure terminals
  1430.  [ ]    Network services
  1431.  [ ]    Trivial ftp (tftp)
  1432.  [ ]    /etc/services
  1433.  [ ]    tcp_wrapper (also known as log_tcp)
  1434.  [ ]    /etc/aliases
  1435.  [ ]    Sendmail
  1436.  [ ]    majordomo
  1437.  [ ]    fingerd
  1438.  [ ]    UUCP
  1439.  [ ]    REXD
  1440.  [ ]    World Wide Web (WWW) - httpd
  1441.  
  1442. 3.0   ftpd and anonymous ftp
  1443.  [ ]    Versions
  1444.  [ ]    Configuration
  1445.  [ ]    Anonymous ftp only
  1446.  [ ]        Configuration of your ftp server
  1447.  [ ]        Permissions
  1448.  [ ]        Writable directories
  1449.  [ ]        Disk mounting
  1450.  
  1451. 4.0   Password and account security
  1452.  [ ]    Policy
  1453.  [ ]    Proactive Checking
  1454.  [ ]    NIS, NIS+ and /etc/passwd entries
  1455.  [ ]    Password shadowing
  1456.  [ ]    Administration
  1457.  [ ]    Special accounts
  1458.  [ ]    Root account
  1459.  [ ]    .netrc files  
  1460.  [ ]    GCOS field  
  1461.  
  1462. 5.0   File system security
  1463.  [ ]    General
  1464.  [ ]    Startup and shutdown scripts
  1465.  [ ]    /usr/lib/expreserve
  1466.  [ ]    External file systems/devices
  1467.  [ ]    File Permissions
  1468.  [ ]    Files run by root
  1469.  [ ]    Bin ownership
  1470.  [ ]    Tiger/COPS
  1471.  [ ]    Tripwire
  1472.  
  1473. 6.0   Vendor operating system specific security
  1474.  [ ]    SunOS 4.1.x
  1475.  [ ]        Patches
  1476.  [ ]        IP forwarding and source routing
  1477.  [ ]        Framebuffers  /dev/fb       
  1478.  [ ]        /usr/kvm/sys/*
  1479.  [ ]        /usr/kvm/crash
  1480.  [ ]        /dev/nit (Network Interface Tap)
  1481.  [ ]        Loadable drivers option
  1482.  [ ]    Solaris 2.x
  1483.  [ ]        Patches
  1484.  [ ]        IP forwarding and source routing
  1485.  [ ]        Framebuffers /dev/fbs
  1486.  [ ]    IRIX
  1487.  [ ]        Patches
  1488.  [ ]    AIX
  1489.  [ ]        Patches
  1490.  [ ]    HPUX
  1491.  [ ]        Patches
  1492.  [ ]    OSF
  1493.  [ ]        Patches
  1494.  [ ]    ULTRIX
  1495.  [ ]        Patches
  1496.  
  1497. 7.0   Security and the X Window System
  1498.  [ ]    Problems with xdm
  1499.  [ ]    X security - General
  1500.  
  1501. ==============================================================================
  1502. Appendix E: Shell Scripts
  1503.  
  1504. E.1   Script for printing the umask value for each user.
  1505.  
  1506. #!/bin/sh
  1507. PATH=/bin:/usr/bin:/usr/etc:/usr/ucb
  1508.  
  1509. HOMEDIRS=`cat /etc/passwd | awk -F":" 'length($6) > 0 {print $6}' | sort -u`
  1510. FILES=".cshrc .login .profile"
  1511.  
  1512. for dir in $HOMEDIRS
  1513. do
  1514.         for file in $FILES
  1515.         do
  1516.                 grep -s umask /dev/null $dir/$file
  1517.         done
  1518. done
  1519.  
  1520. ==============================================================================
  1521. Appendix F: Table of operating systems by flavour
  1522.  
  1523.    Operating System             SVR4-like       BSD-like         Other
  1524.    -------------------------------------------------------------------
  1525.    |                                                                 |
  1526.    | SunOS 4.1.x                                   *                 |
  1527.    |                                                                 |
  1528.    | Solaris 2.x                   *                                 |
  1529.    |                                                                 |
  1530.    | Solaris intel86 x.x           *                                 |
  1531.    |                                                                 |
  1532.    | Irix x.x                      *                                 |
  1533.    |                                                                 |
  1534.    | HP/UX x.x                     *                                 |
  1535.    |                                                                 |
  1536.    | Ultrix x.x                                    *                 |
  1537.    |                                                                 |
  1538.    | OSF x.x                       *                                 |
  1539.    |                                                                 |
  1540.    | *BSD* x.x                                     *                 |
  1541.    |                                                                 |
  1542.    | Linux x.x                     *                                 |
  1543.    |                                                                 |
  1544.    | AIX x.x                                                     *   |
  1545.    |                                                                 |
  1546.    | SCO x.x                                                     *   |
  1547.    |                                                                 |
  1548.    -------------------------------------------------------------------
  1549.  
  1550. ==============================================================================
  1551. Appendix G: List of commands by flavour
  1552.  
  1553. Notes:
  1554.  1.  The commands given here are examples only.  Please consult the manual
  1555.      pages for your system if you are unsure of the consequence of any
  1556.      command.
  1557.  2.  BSD-style commands are marked as BSD commands, similarly for SVR4.
  1558.  3.  Commands which are not labelled are expected to work for both.
  1559.  4.  Full directory paths and program options may vary for different flavours
  1560.      of UNIX. If in doubt, consult your vendor documentation. 
  1561.  
  1562. G.1  Restart inetd
  1563.  
  1564. BSD commands
  1565.      # /bin/ps -aux | /bin/grep inetd | /bin/grep -v grep
  1566.      # /bin/kill -HUP <inetd-PID>
  1567.  
  1568. SVR4 commands
  1569.      # /bin/ps -ef | /bin/grep inetd | /bin/grep -v grep
  1570.      # /bin/kill -HUP <inetd-PID>
  1571.  
  1572. G.2  Ascertain which services are registered with the portmapper
  1573.  
  1574.      # /usr/bin/rpcinfo -p  
  1575.  
  1576. G.3  Rebuild alias maps
  1577.  
  1578.      # /usr/bin/newaliases
  1579.  
  1580.    If you run NIS (YP), you will then need to rebuild your maps to have the
  1581.    change take effect over all clients:
  1582.      # (cd /var/yp; /usr/bin/make aliases)
  1583.  
  1584. G.4  Test whether sendmail wizard password is enabled
  1585.  
  1586.      % telnet hostname 25
  1587.      wiz
  1588.      debug
  1589.      kill
  1590.      quit
  1591.      %
  1592.  
  1593.    You should see the response "5nn error return"  (e.g., "500 Command
  1594.    unrecognized") after each of the commands  'wiz', 'debug' and 'kill'. 
  1595.    Otherwise, your version of sendmail may be vulnerable. If you are unsure
  1596.    whether your version is vulnerable, update it.
  1597.  
  1598. G.5  Set sendmail log level to 9
  1599.  
  1600.    Include lines describing the log level (similar to the following two) in
  1601.    the options part of the general configuration information section of the
  1602.    sendmail configuration file:
  1603.      # log level
  1604.      OL9   
  1605.  
  1606.    The log level syntax changed in sendmail 8.7 to:
  1607.      # log level
  1608.      O LogLevel=9
  1609.  
  1610. G.6  Set syslog log level for mail messages
  1611.  
  1612.    Include lines describing the logging required (similar to the following
  1613.    two) in the syslog.conf file: 
  1614.      mail.info                       /dev/console
  1615.      mail.info                       /var/adm/messages 
  1616.  
  1617.    For the change to take effect, you must then instruct syslog to reread
  1618.    the configuration file.  
  1619.  
  1620. BSD commands
  1621.    Get the current PID of syslog:
  1622.      # /bin/ps -aux | /bin/grep syslogd | /bin/grep -v grep
  1623.    Then tell syslog to reread its configuration file:
  1624.      # /bin/kill -HUP <syslog-PID>
  1625.  
  1626. SVR4 commands:
  1627.    Get the current PID of syslog:
  1628.      # /bin/ps -ef | /bin/grep syslogd | /bin/grep -v grep
  1629.    Then tell syslog to reread its configuration file:
  1630.      # /bin/kill -HUP <syslog-PID>
  1631.  
  1632.    NOTE: In the logs, look for error messages like:
  1633.          - mail to or from a single pipe ("|")
  1634.          - mail to or from an obviously invalid user (e.g., bounce or blah)
  1635.  
  1636. G.7  (Rebuilding and) restarting sendmail(8)
  1637.  
  1638.    To rebuild the frozen configuration file, firstly do:
  1639.      # /usr/lib/sendmail -bz
  1640.  
  1641.    NOTE: The above process does not apply to sendmail v8.x which does not
  1642.          support frozen configuration files.
  1643.  
  1644.    To restart sendmail(8), you should kill *all* existing sendmail(8) 
  1645.    processes by sending them a TERM signal using kill, then restart
  1646.    sendmail(8).  
  1647.  
  1648. BSD commands
  1649.    Get the pid of every running sendmail process:
  1650.      # /bin/ps -aux | /bin/grep sendmail | /bin/grep -v grep
  1651.    Kill every running sendmail process and restart sendmail:
  1652.      # /bin/kill <pid>     #pid of every running sendmail process
  1653.      # /usr/lib/sendmail -bd -q1h
  1654.  
  1655. SVR4 commands
  1656.    Get the pid of every running sendmail process:
  1657.      # /bin/ps -ef | /bin/grep sendmail | /bin/grep -v grep
  1658.    Kill every running sendmail process and restart sendmail:
  1659.      # /bin/kill <pid>     #pid of every running sendmail process
  1660.      # /usr/lib/sendmail -bd -q1h
  1661.  
  1662. G.8  Test whether ftpd supports SITE EXEC 
  1663.  
  1664.    For normal users:
  1665.  
  1666.      % telnet localhost 21
  1667.      USER username
  1668.      PASS password
  1669.      SITE EXEC
  1670.  
  1671.    For anonymous users:
  1672.  
  1673.      % telnet localhost 21
  1674.      USER ftp
  1675.      PASS username@domainname.au
  1676.      SITE EXEC
  1677.  
  1678.    You should see the response "5nn error return"  (e.g., "500 'SITE
  1679.    EXEC' command not understood").  If your ftp daemon has SITE EXEC
  1680.    enabled, make sure you have the most recent version of the daemon (e.g.,
  1681.    wu-ftp 2.4).  Older versions of ftpd allow any user to gain shell access
  1682.    using the SITE EXEC command.  Use QUIT to end the telnet session.
  1683.  
  1684. G.9  Ascertain whether anonymous ftp is enabled
  1685.  
  1686.      % ftp localhost
  1687.      Connected to localhost
  1688.      220 hostname FTP server ready
  1689.      Name (localhost:username):  anonymous
  1690.      331 Guest login ok, send username as password
  1691.      Password:  user@domain.au 
  1692.      230 Guest login ok, access restrictions apply.
  1693.      Remote system type is UNIX.
  1694.      Using binary mode to transfer files.
  1695.      ftp>
  1696.  
  1697. G.10  Ensure that * in the password field is correctly implemented 
  1698.    
  1699.    1. Try using NIS with the '*' in the password field for example:
  1700.         +:*:0:0:::      
  1701.       If NIS users cannot log in to that machine, remove the '*' and  try
  1702.       the next test.
  1703.  
  1704.    2. With the '*' removed, try logging in again.  If NIS users can log in
  1705.       AND you can also log in unauthenticated as the user '+', then your
  1706.       implementation is vulnerable.  Contact the vendor for more information. 
  1707.       If NIS users can log in AND you cannot log in as the user '+', your
  1708.       implementation should not be vulnerable to this problem.
  1709.  
  1710. G.11  Find .exrc files
  1711.                    
  1712.      # /bin/find /  -name '.exrc' -exec /bin/cat {} \; -print
  1713.  
  1714.    See also G.19.
  1715.  
  1716. G.12  Locate and print .forward files
  1717.  
  1718.      # /bin/find / -name '.forward' -exec /bin/cat {} \; -print
  1719.  
  1720.    See also G.19.
  1721.  
  1722. G.13  Remove execute permission on /usr/lib/expreserve
  1723.  
  1724.      # /bin/chmod 400 /usr/lib/expreserve
  1725.  
  1726. G.14  Set ownership and permissions for /tmp correctly
  1727.  
  1728.      # /bin/chown root /tmp
  1729.      # /bin/chgrp 0 /tmp
  1730.      # /bin/chmod 1777 /tmp
  1731.  
  1732.    NOTE: This will NOT recursively set the sticky bit on sub-directories
  1733.          below /tmp, such as /tmp/.X11-unix and /tmp/.NeWS-unix; you may 
  1734.          have to set these manually or through the system startup files.
  1735.  
  1736. G.15  Find group and world writable files and directories
  1737.  
  1738.      # /bin/find / -type f \( -perm -2 -o -perm -20 \) -exec ls -lg {} \;
  1739.  
  1740.      # /bin/find / -type d \( -perm -2 -o -perm -20 \) -exec ls -ldg {} \;
  1741.  
  1742.    See also G.19.
  1743.  
  1744. G.16  Find files with the SUID or SGID bit enabled
  1745.  
  1746.      # /bin/find / -type f \( -perm -004000 -o -perm -002000 \) \
  1747.        -exec ls -lg {} \;
  1748.  
  1749.    See also G.19.
  1750.  
  1751. G.17  Find normal files in /dev
  1752.  
  1753.      # /bin/find /dev -type f -exec ls -l {} \;
  1754.  
  1755.    See also G.19.
  1756.  
  1757. G.18  Find block or character special files
  1758.  
  1759.      # /bin/find / \( -type b -o -type c \) -print | grep -v '^/dev/'
  1760.  
  1761.    See also G.19.
  1762.  
  1763. G.19  Avoid NFS mounted file systems when using /bin/find
  1764.  
  1765.      # /bin/find / \( \! -fstype nfs -o -prune \) <expression>
  1766.  
  1767.   As an example, <expression> could be
  1768.      -type f \( -perm -004000 -o -perm -002000 \) -exec ls -lg {} \;
  1769.  
  1770.  
  1771. ==============================================================================
  1772. The AUSCERT team have made every effort to ensure that the information 
  1773. contained in this checklist is accurate.  However, the decision to use the 
  1774. tools and techniques described is the responsibility of each user or 
  1775. organisation.  The appropriateness of each item for an organisation or 
  1776. individual system should be considered before application in conjunction with 
  1777. local policies and procedures.  AUSCERT takes no responsibility for the 
  1778. consequences of applying the contents of this document.  
  1779.  
  1780. AUSCERT acknowledges technical input and review of this document by CERT
  1781. Coordination Center and DFN-CERT and comments from users of this document.
  1782.  
  1783. Permission is granted to copy and distribute this document provided that The 
  1784. University of Queensland copyright is acknowledged.
  1785.  
  1786. (C) Copyright 1995 The University of Queensland
  1787. ==============================================================================
  1788.  
  1789. If you believe that your system has been compromised, contact AUSCERT or your
  1790. representative in FIRST (Forum of Incident Response and Security Teams).
  1791.  
  1792. Internet Email: auscert@auscert.org.au
  1793. AUSCERT Hotline:     (07) 3365 4417    (International: + 61 7 3365 4417)
  1794.       Facsimile:     (07) 3365 4477
  1795.           AUSCERT personnel answer during business hours (AEST - GMT+10:00),
  1796.           on call after hours for emergencies.
  1797.                   
  1798.  
  1799. Australian Computer Emergency Response Team
  1800. c/- Prentice Centre
  1801. The University of Queensland
  1802. Brisbane, Queensland 4072.
  1803. Australia
  1804.  
  1805. -----BEGIN PGP SIGNATURE-----
  1806. Version: 2.6.2i
  1807. Comment: Finger pgp@ftp.auscert.org.au to retrieve AUSCERT's public key
  1808.  
  1809. iQCVAwUBMNdrTih9+71yA2DNAQH9sQP/aWGDwRG80e4oz6pgeRRkzB25tm0D12ew
  1810. 8zXBldNrbGC1s0h4U//G/WPNvWeF4Llr7GAAevTxwc8RMeDS9N3Aw5YTpPXaOE+x
  1811. WSqHDEQfCwRgiOJc4sw3GA9r7/HYcwi81E06gNwmFTDU+IMmAiKCBisw/vNCnHS9
  1812. RztMITIV7is=
  1813. =wZf1
  1814. -----END PGP SIGNATURE-----
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821. ... texts ...